//此文件是用于定义各种数据类型
//多个文件共用的数据
export interface Params {
    keyword:string,
    pageNum:number,
    pageSize:number
}
export interface Meta {
    views: number;
    likes: number;
    comments: number;
  }
  
  export interface ToUser {
    user_id: string;
    name: string;
    avatar: string;
    type: number;
  }


//Nav
export interface NavListItem{
    index :string,
    name :string,
    path :string
}

//LoginOrRegister.vue
//登录参数
export interface LoginParams{
    email:string,
    password:string
}
//用户信息
export interface UserInfo{
    _id: string,
    name: string,
    avatar:string |any
}
//注册参数
export interface LogOrRegParams{
    email:string,
    name:string,
    password:string,
    phone:string,
    descri:string
}
  
  
//Articles.vue
// 文章列表
export interface ArticlesParams{
    author:string,
    keyword:string,
    likes:string,//是否是热门文章
    state:number,//文章发布状态(0:草稿 1:已发布)
    tag_id:string,
    category_id:string,
    pageNum:number,
    pageSize:number,
}

export interface ArticlesData {
  count: number,
  list: Array<any> | any
}
//ArticleDetail.vue
//文章详情请求参数
export interface ArtiDetailParams{
    id:string|string[],
    type:number
}
//文章详情返回结果
export interface ArtiDetailInfo {
    toc: string;
    _id: string;
    author: string;
    category: Array<any>;
    comments: Array<Comments>;
    create_time: string;
    desc: string;
    content: string;
    id: number;
    img_url: string;
    numbers: number;
    keyword: Array<string>;
    like_users: Array<any>;
    meta: Meta;
    origin: number;
    state: number;
    tags: Array<any>;
    title: string;
    update_time: string;
  }
//评论
export interface Comments {
    article_id: string;
    content: string;
    create_time: string;
    id: number;
    is_handle: number;
    is_top: boolean;
    likes: number;
    other_comments: OtherComments[];
    state: number;
    update_time: string;
    user: ToUser;
    user_id: string;
    __v: number;
    _id: string;
  }
//其他评论
export interface OtherComments {
    content: string;
    create_time: string;
    likes: number;
    state: number;
    to_user: ToUser;
    user: ToUser;
    _id: string;
  }


//Aside.vue
//标签请求参数
export interface TagParams {
    keyword:string,
    pageNum:number,
    pageSize:number
}
export interface TagList {
  name: string;
  id: number;
}
export interface TagsData {
  count: number;
  list: TagList | any;
}
//Message.vue
//留言参数
export interface MessageParams{
    email:string,
    phone:string,
    name:string,
    content:string
}
export interface RulesItem{
    validator:Function,
    trigger:string
}
export interface MegRules{
    email:RulesItem[],
    phone:RulesItem[],
    content:RulesItem[]
}

//Archive.vue
//归档列表请求参数
export interface ArchiveParams{
    keyword: string;
    likes: string; // 是否是热门文章
    state: number; // 文章发布状态 => 0 草稿，1 已发布,'' 代表所有文章
    article: number;
    tag_id: string;
    category_id: string;
    pageNum: number;
    pageSize: number;
}

//Project.vue
//项目列表
export interface ProjectList {
    content: string;
    end_time: string;
    img: string;
    start_time: string;
    title: string;
    url: string;
    id: string;
  }
  
  export interface ProjectsData {
    count: number;
    list: ProjectList | any;
  }
  //响应参数
  export interface ResponseData{
    code: number;
    data?: any;
    message: string;
  }